import { ajax, post } from '@/utils/ajax';

// 获取流程图
export function showFlowStaticImg(modelId, deploymentId) {
    const config = {
        url: '/wf/manager/deployment/showFlowStaticImg',
        method: 'post',
        data: { modelId, deploymentId },
        responseType: 'arraybuffer'
    }
    return ajax(config);
}

// 获取待办流程过程流程图
export function showFlowRunImgByInstantId(processInstanceId) {
    const config = {
        url: '/wf/manager/deployment/showFlowRunImgByInstantId',
        method: 'post',
        data: { processInstanceId },
        responseType: 'arraybuffer'
    }
    return ajax(config);
}

// 获取待办流程过程审批人员
export function getProcessRunTaskAndApprover(processInstanceId) {
    return post('/wf/task/done/getProcessRunTaskAndApprover', { processInstanceId })
}

// 获取待办流程审批记录
export function getApproveHistory(processInstanceId) {
    return post('/wf/task/done/getApproveHistoryPage', { processInstanceId });
}

// 获取流程以及节点上定义审批按钮
export function getWfButton(taskId) {
    return post('/wf/task/todo/getApproveButtons', { taskId });
}

// 获取下一步处理人信息
export function selectWfNextUser(param) {
    return post('/wf/manager/instance/selectWfNextUser', param, { objectAsMap: true });
}